#include "skyBox.h"

SkyBox::SkyBox(void)
{
}

SkyBox::SkyBox(std::map<SIDE,std::string> textures, int size)
{
	/*m_textureLoader = new TextureLoader();
	
	glTexture* texture = NULL;
	for (std::map<SIDE,std::string>::iterator it = textures.begin(); it != textures.end(); ++it)
	{
		SIDE side = it->first;
		std::string textureName = it->second;

		glTexture* texture = new glTexture();
		m_textureLoader->LoadTextureFromDisk(textureName.c_str(),texture);

		m_textures[side] = texture;
	}*/

	m_surfaces[LEFT] = new SweptSurface(textures[LEFT],size,1);
	m_surfaces[RIGHT] = new SweptSurface(textures[RIGHT],size,1);
	m_surfaces[TOP] = new SweptSurface(textures[TOP],size,1);
	m_surfaces[BOTTOM] = new SweptSurface(textures[BOTTOM],size,1);
	m_surfaces[BACK] = new SweptSurface(textures[BACK],size,1);
	m_surfaces[FRONT] = new SweptSurface(textures[FRONT],size,1);

}

SkyBox::~SkyBox(void)
{
	
	/*if (m_textureLoader != NULL)
	{
		for (std::map<SIDE,glTexture*>::iterator it = m_textures.begin(); it != m_textures.end(); ++it)
		{		
			m_textureLoader->FreeTexture(it->second);
		}
	}

	if (m_textureLoader!=NULL)
		delete m_textureLoader;

	for (std::map<SIDE,glTexture*>::iterator it = m_textures.begin(); it != m_textures.end(); ++it)
	{		
		delete (it->second);
	}*/
		
}


void SkyBox::Update(float dt)
{
}

void SkyBox::Render()
{
	glDepthMask(0);



	glDepthMask(1);
}
